package cn.gson.springboot.model.mapper;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.alibaba.fastjson.JSONArray;

import cn.gson.springboot.model.pojos.ClinicCard;

@Mapper
public interface ClinicCardMapper {
	
	//新增医疗卡
	public void addcliniccard(@Param("cliniccard_id") String cliniccardid,@Param("clinic_name") String clinicname,
													 @Param("clinic_idnumber") String clinicCard,@Param("clinic_age") Integer clinicage,
													 @Param("clinic_sex") String clinic_sex,@Param("clinic_tel") String clinic_tel,
													 @Param("clinic_address") String clinic_address,
													 @Param("clinic_handlename") String clinic_handlename,
													 @Param("clinic_remainmoney")BigDecimal clinic_remainmoney,
													 @Param("clinic_state")Integer clinic_state);
	
 //根据医疗卡查询或者查询所有
public List<ClinicCard> selectAllbycardid(@Param("clinicstate") Integer clinicstate,
										  @Param("cliniccardid")String cliniccardid,
										  @Param("clinicname") String clinicname,
										  @Param("clinic_idnumber") String clinic_idnumber);
	
	//修改余额(加)
	public void updatemoney(@Param("money")BigDecimal money,
													   @Param("clinicid")Integer clinicid);
	
	//修改余额(减)
	public void updatejianmoney(@Param("moneys")BigDecimal money,
													         @Param("clinicids")Integer clinicid);
	
	
	//看诊医疗卡搜索
	public JSONArray lookdoctorclinic(@Param("regstrstate")Integer regstrstate,
																	   @Param("cliniccardid")String cliniccardid,
																	   @Param("sectionid")Integer sectionid,
																	   @Param("regstrid")Integer regstrid);
	
	//叫号信息
	public JSONArray lookdoctorCall(@Param("regstrcall")Integer regstrcall,
																	@Param("regstrstate")Integer regstrstate,
																   @Param("cliniccardid")String cliniccardid,
																   @Param("sectionid")Integer sectionid,
																   @Param("regstrid")Integer regstrid);
	
	//根据登录人用户id查对应科室id以便看诊出现对应病人
	public JSONArray selectLookDoctorBysid(@Param("rolename")String rolename,
			   																		@Param("userid")Integer userid);
	
	//收费查询
	public JSONArray chargemoneylookillnessid (@Param("lookstate")Integer lookstate,
																						   @Param("lookid")Integer lookid);
	
	//药物收费
	public JSONArray selectdrugMoney(@Param("dmoneytype") Integer dmoneytype,@Param("lookid")Integer lookid);
	
	//体检项目收费
	public JSONArray selecthealMoney(@Param("lookid")Integer lookid);
	
	//自主体检人员信息
	public JSONArray selectselfhealthClinic();
	
	//自主体检收费
	public JSONArray selectselfhealthmoney(@Param("cid")String cid);
	
	//医疗项目收费
	public JSONArray selectHosptialMoney(@Param("llid")Integer llid);
	
	//住院申请
	public JSONArray selectapplyhospital(@Param("lid")Integer lid);
	
	/*根据挂号id查询看诊号*/
	public JSONArray selectByLookid(@Param("registr_id")Integer registr_id);
	
	//病历本看诊记录
	public JSONArray selectBylookrecord(@Param("cid")Integer cid,@Param("lookdate") Date lookdate);
	
	//病历本体检记录与结果
	public JSONArray selectByhealthrecord(@Param("cid")Integer cid,@Param("lookdate") Date lookdate); 
	
	//查询当天挂号记录
	public JSONArray selectByPresentRegistrPeople();
}
